package com.czk.gulimall.product.feign;

import com.czk.common.to.es.SkuEsModel;
import com.czk.common.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * feign的调用流程
 * 1 构建请求数据，将对象转为json
 * 2 发送请求执行（执行成功会解码响应数据）
 * 3 执行请求会有重试机制
 *  while(true){
 *      try(){
 *
 *      }catch(){
 *          retryer.continueOrPropagete(e)
 *          continue
 *      }
 *       }
 * @Author:ChenZhangKun
 * @Date: 2021/12/24 15:45
 */
@FeignClient(value = "gulimall-search")
public interface SearchFeignService {
    @PostMapping("/search/product")
    R productStatusUp(@RequestBody List<SkuEsModel> skuEsModels);
}
